<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Conditional variance</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Conditional_variance"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.math.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Conditional_variance rootpage-Conditional_variance skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Conditional variance</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p>In <a href="Probability_theory" title="Probability theory">probability theory</a> and <a href="Statistics" title="Statistics">statistics</a>, a <b>conditional variance</b> is the <a href="Variance" title="Variance">variance</a> of a <a href="Random_variable" title="Random variable">random variable</a> given the value(s) of one or more other variables.
Particularly in <a href="Econometrics" title="Econometrics">econometrics</a>, the conditional variance is also known as the <b>scedastic function</b> or <b>skedastic function</b>.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> Conditional variances are important parts of <a href="Autoregressive_conditional_heteroskedasticity" title="Autoregressive conditional heteroskedasticity">autoregressive conditional heteroskedasticity</a> (ARCH) models.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Definition">Definition</h2></div>
<p>The conditional variance of a <a href="Random_variable" title="Random variable">random variable</a> <i>Y</i> given another random variable <i>X</i> is
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \operatorname {Var} (Y\mid X)=\operatorname {E} {\Big (}{\big (}Y-\operatorname {E} (Y\mid X){\big )}^{2}\;{\Big |}\;X{\Big )}.}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>Var</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mo>∣<!-- ∣ --></mo>
<mi>X</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mo maxsize="1.623em" minsize="1.623em">(</mo>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mo maxsize="1.2em" minsize="1.2em">(</mo>
</mrow>
</mrow>
<mi>Y</mi>
<mo>−<!-- − --></mo>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mo>∣<!-- ∣ --></mo>
<mi>X</mi>
<mo stretchy="false">)</mo>
<msup>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mo maxsize="1.2em" minsize="1.2em">)</mo>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mspace width="thickmathspace"></mspace>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mo maxsize="1.623em" minsize="1.623em">|</mo>
</mrow>
</mrow>
<mspace width="thickmathspace"></mspace>
<mi>X</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mo maxsize="1.623em" minsize="1.623em">)</mo>
</mrow>
</mrow>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \operatorname {Var} (Y\mid X)=\operatorname {E} {\Big (}{\big (}Y-\operatorname {E} (Y\mid X){\big )}^{2}\;{\Big |}\;X{\Big )}.}</annotation>
</semantics>
</math></span><img src="./750b42226c59f18a13f22afc71166ec0a09bedbb.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.838ex; width:40.605ex; height:4.843ex;" alt="{\displaystyle \operatorname {Var} (Y\mid X)=\operatorname {E} {\Big (}{\big (}Y-\operatorname {E} (Y\mid X){\big )}^{2}\;{\Big |}\;X{\Big )}.}" loading="lazy"></span></dd></dl>
<p>The conditional variance tells us how much variance is left if we use <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \operatorname {E} (Y\mid X)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mo>∣<!-- ∣ --></mo>
<mi>X</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \operatorname {E} (Y\mid X)}</annotation>
</semantics>
</math></span><img src="./5a4fb746bdafbfa9dba63118127b8307410e2a95.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:9.083ex; height:2.843ex;" alt="{\displaystyle \operatorname {E} (Y\mid X)}" loading="lazy"></span> to "predict" <i>Y</i>.
Here, as usual, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \operatorname {E} (Y\mid X)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mo>∣<!-- ∣ --></mo>
<mi>X</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \operatorname {E} (Y\mid X)}</annotation>
</semantics>
</math></span><img src="./5a4fb746bdafbfa9dba63118127b8307410e2a95.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:9.083ex; height:2.843ex;" alt="{\displaystyle \operatorname {E} (Y\mid X)}" loading="lazy"></span> stands for the <a href="Conditional_expectation" title="Conditional expectation">conditional expectation</a> of <i>Y</i> given <i>X</i>,
which we may recall, is a random variable itself (a function of <i>X</i>, determined up to probability one).
As a result, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \operatorname {Var} (Y\mid X)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>Var</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mo>∣<!-- ∣ --></mo>
<mi>X</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \operatorname {Var} (Y\mid X)}</annotation>
</semantics>
</math></span><img src="./68cef02d91813c8776602d1b883e02760d4396b0.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:11.317ex; height:2.843ex;" alt="{\displaystyle \operatorname {Var} (Y\mid X)}" loading="lazy"></span> itself is a random variable (and is a function of <i>X</i>).
</p>
<div class="mw-heading mw-heading2"><h2 id="Explanation,_relation_to_least-squares">Explanation, relation to least-squares</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1236090951">
/* start https://en.wikipedia.org/ */
.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}
/* end https://en.wikipedia.org/ */
</style><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Least-squares" class="mw-redirect" title="Least-squares">least-squares</a></div>
<p>Recall that variance is the expected squared deviation between a random variable (say, <i>Y</i>) and its expected value.
The expected value can be thought of as a reasonable prediction of the outcomes of the random experiment (in particular, the expected value is the best constant prediction when predictions are assessed by expected squared prediction error). Thus, one interpretation of variance is that it gives the smallest possible expected squared prediction error. If we have the knowledge of another random variable (<i>X</i>) that we can use to predict <i>Y</i>, we can potentially use this knowledge to reduce the expected squared error. As it turns out, the best prediction of <i>Y</i> given <i>X</i> is the conditional expectation. In particular, for any <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f:\mathbb {R} \to \mathbb {R} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>f</mi>
<mo>:</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">R</mi>
</mrow>
<mo stretchy="false">→<!-- → --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">R</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle f:\mathbb {R} \to \mathbb {R} }</annotation>
</semantics>
</math></span><img src="./1e3a10a3ad05781f5cf9c2d875a02227e21a8448.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:10.186ex; height:2.509ex;" alt="{\displaystyle f:\mathbb {R} \to \mathbb {R} }" loading="lazy"></span> measurable,
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\begin{aligned}\operatorname {E} [(Y-f(X))^{2}]&=\operatorname {E} [(Y-\operatorname {E} (Y|X)\,\,+\,\,\operatorname {E} (Y|X)-f(X))^{2}]\\&=\operatorname {E} [\operatorname {E} \{(Y-\operatorname {E} (Y|X)\,\,+\,\,\operatorname {E} (Y|X)-f(X))^{2}|X\}]\\&=\operatorname {E} [\operatorname {Var} (Y|X)]+\operatorname {E} [(\operatorname {E} (Y|X)-f(X))^{2}]\,.\end{aligned}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mtable columnalign="right left right left right left right left right left right left" rowspacing="3pt" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" displaystyle="true">
<mtr>
<mtd>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">[</mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mo>−<!-- − --></mo>
<mi>f</mi>
<mo stretchy="false">(</mo>
<mi>X</mi>
<mo stretchy="false">)</mo>
<msup>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo stretchy="false">]</mo>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">[</mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mo>−<!-- − --></mo>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo stretchy="false">)</mo>
<mspace width="thinmathspace"></mspace>
<mspace width="thinmathspace"></mspace>
<mo>+</mo>
<mspace width="thinmathspace"></mspace>
<mspace width="thinmathspace"></mspace>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo stretchy="false">)</mo>
<mo>−<!-- − --></mo>
<mi>f</mi>
<mo stretchy="false">(</mo>
<mi>X</mi>
<mo stretchy="false">)</mo>
<msup>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo stretchy="false">]</mo>
</mtd>
</mtr>
<mtr>
<mtd></mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">[</mo>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo fence="false" stretchy="false">{</mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mo>−<!-- − --></mo>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo stretchy="false">)</mo>
<mspace width="thinmathspace"></mspace>
<mspace width="thinmathspace"></mspace>
<mo>+</mo>
<mspace width="thinmathspace"></mspace>
<mspace width="thinmathspace"></mspace>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo stretchy="false">)</mo>
<mo>−<!-- − --></mo>
<mi>f</mi>
<mo stretchy="false">(</mo>
<mi>X</mi>
<mo stretchy="false">)</mo>
<msup>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo fence="false" stretchy="false">}</mo>
<mo stretchy="false">]</mo>
</mtd>
</mtr>
<mtr>
<mtd></mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">[</mo>
<mi>Var</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">]</mo>
<mo>+</mo>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">[</mo>
<mo stretchy="false">(</mo>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo stretchy="false">)</mo>
<mo>−<!-- − --></mo>
<mi>f</mi>
<mo stretchy="false">(</mo>
<mi>X</mi>
<mo stretchy="false">)</mo>
<msup>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo stretchy="false">]</mo>
<mspace width="thinmathspace"></mspace>
<mo>.</mo>
</mtd>
</mtr>
</mtable>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\begin{aligned}\operatorname {E} [(Y-f(X))^{2}]&=\operatorname {E} [(Y-\operatorname {E} (Y|X)\,\,+\,\,\operatorname {E} (Y|X)-f(X))^{2}]\\&=\operatorname {E} [\operatorname {E} \{(Y-\operatorname {E} (Y|X)\,\,+\,\,\operatorname {E} (Y|X)-f(X))^{2}|X\}]\\&=\operatorname {E} [\operatorname {Var} (Y|X)]+\operatorname {E} [(\operatorname {E} (Y|X)-f(X))^{2}]\,.\end{aligned}}}</annotation>
</semantics>
</math></span><img src="./53a7661b7f329003e656ea07186194e23e37ec09.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -4.072ex; margin-bottom: -0.266ex; width:64.042ex; height:9.843ex;" alt="{\displaystyle {\begin{aligned}\operatorname {E} [(Y-f(X))^{2}]&=\operatorname {E} [(Y-\operatorname {E} (Y|X)\,\,+\,\,\operatorname {E} (Y|X)-f(X))^{2}]\\&=\operatorname {E} [\operatorname {E} \{(Y-\operatorname {E} (Y|X)\,\,+\,\,\operatorname {E} (Y|X)-f(X))^{2}|X\}]\\&=\operatorname {E} [\operatorname {Var} (Y|X)]+\operatorname {E} [(\operatorname {E} (Y|X)-f(X))^{2}]\,.\end{aligned}}}" loading="lazy"></span></dd></dl>
<p>By selecting <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f(X)=\operatorname {E} (Y|X)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>f</mi>
<mo stretchy="false">(</mo>
<mi>X</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle f(X)=\operatorname {E} (Y|X)}</annotation>
</semantics>
</math></span><img src="./4dcf35f4e027f1d9b2114b118c07152f20165f65.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:15.959ex; height:2.843ex;" alt="{\displaystyle f(X)=\operatorname {E} (Y|X)}" loading="lazy"></span>, the second, nonnegative term becomes zero, showing the claim.
Here, the second equality used the <a href="Law_of_total_expectation" title="Law of total expectation">law of total expectation</a>.
We also see that the expected conditional variance of <i>Y</i> given <i>X</i> shows up as the irreducible error of predicting <i>Y</i> given only the knowledge of <i>X</i>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Special_cases,_variations">Special cases, variations</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Conditioning_on_discrete_random_variables">Conditioning on discrete random variables</h3></div>
<p>When <i>X</i> takes on countable many values <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle S=\{x_{1},x_{2},\dots \}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>S</mi>
<mo>=</mo>
<mo fence="false" stretchy="false">{</mo>
<msub>
<mi>x</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
<mo>,</mo>
<msub>
<mi>x</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
<mo>,</mo>
<mo>…<!-- … --></mo>
<mo fence="false" stretchy="false">}</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle S=\{x_{1},x_{2},\dots \}}</annotation>
</semantics>
</math></span><img src="./33e573264b01f72e1ee8f58d0652bc304a21e87b.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:16.482ex; height:2.843ex;" alt="{\displaystyle S=\{x_{1},x_{2},\dots \}}" loading="lazy"></span> with positive probability, i.e., it is a <a href="Discrete_random_variable" class="mw-redirect" title="Discrete random variable">discrete random variable</a>, we can introduce <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \operatorname {Var} (Y|X=x)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>Var</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo>=</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \operatorname {Var} (Y|X=x)}</annotation>
</semantics>
</math></span><img src="./a66f3b2841f2ad6a14a857e03d3736d6c34ffce3.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:14.455ex; height:2.843ex;" alt="{\displaystyle \operatorname {Var} (Y|X=x)}" loading="lazy"></span>, the conditional variance of <i>Y</i> given that <i>X=x</i> for any <i>x</i> from <i>S</i> as follows:
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \operatorname {Var} (Y|X=x)=\operatorname {E} ((Y-\operatorname {E} (Y\mid X=x))^{2}\mid X=x)=\operatorname {E} (Y^{2}|X=x)-\operatorname {E} (Y|X=x)^{2},}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>Var</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo>=</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mo>−<!-- − --></mo>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mo>∣<!-- ∣ --></mo>
<mi>X</mi>
<mo>=</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<msup>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>∣<!-- ∣ --></mo>
<mi>X</mi>
<mo>=</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<msup>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo>=</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>−<!-- − --></mo>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo>=</mo>
<mi>x</mi>
<msup>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>,</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \operatorname {Var} (Y|X=x)=\operatorname {E} ((Y-\operatorname {E} (Y\mid X=x))^{2}\mid X=x)=\operatorname {E} (Y^{2}|X=x)-\operatorname {E} (Y|X=x)^{2},}</annotation>
</semantics>
</math></span><img src="./56882c14c24a7ed494c27d1dcdc842058964bd0a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:83.541ex; height:3.176ex;" alt="{\displaystyle \operatorname {Var} (Y|X=x)=\operatorname {E} ((Y-\operatorname {E} (Y\mid X=x))^{2}\mid X=x)=\operatorname {E} (Y^{2}|X=x)-\operatorname {E} (Y|X=x)^{2},}" loading="lazy"></span></dd></dl>
<p>where recall that <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \operatorname {E} (Z\mid X=x)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Z</mi>
<mo>∣<!-- ∣ --></mo>
<mi>X</mi>
<mo>=</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \operatorname {E} (Z\mid X=x)}</annotation>
</semantics>
</math></span><img src="./09598afdfc7e21431eb5cb95dba46d23a889b589.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:13.418ex; height:2.843ex;" alt="{\displaystyle \operatorname {E} (Z\mid X=x)}" loading="lazy"></span> is the <a href="Conditional_expectation#Conditional_expectation_with_respect_to_a_random_variable" title="Conditional expectation">conditional expectation of <i>Z</i> given that <i>X=x</i></a>, which is well-defined for <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x\in S}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>x</mi>
<mo>∈<!-- ∈ --></mo>
<mi>S</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle x\in S}</annotation>
</semantics>
</math></span><img src="./51186ba8afb2067573a9082d55dd383df1ea9214.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:5.67ex; height:2.176ex;" alt="{\displaystyle x\in S}" loading="lazy"></span>.
An alternative notation for <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \operatorname {Var} (Y|X=x)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>Var</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo>=</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \operatorname {Var} (Y|X=x)}</annotation>
</semantics>
</math></span><img src="./a66f3b2841f2ad6a14a857e03d3736d6c34ffce3.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:14.455ex; height:2.843ex;" alt="{\displaystyle \operatorname {Var} (Y|X=x)}" loading="lazy"></span> is <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \operatorname {Var} _{Y\mid X}(Y|x).}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>Var</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>Y</mi>
<mo>∣<!-- ∣ --></mo>
<mi>X</mi>
</mrow>
</msub>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \operatorname {Var} _{Y\mid X}(Y|x).}</annotation>
</semantics>
</math></span><img src="./7f99e1ec1da6b76a3ab1e2ac8fddcf4816fd97a1.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.171ex; width:13.367ex; height:3.176ex;" alt="{\displaystyle \operatorname {Var} _{Y\mid X}(Y|x).}" loading="lazy"></span>
</p><p>Note that here <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \operatorname {Var} (Y|X=x)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>Var</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo>=</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \operatorname {Var} (Y|X=x)}</annotation>
</semantics>
</math></span><img src="./a66f3b2841f2ad6a14a857e03d3736d6c34ffce3.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:14.455ex; height:2.843ex;" alt="{\displaystyle \operatorname {Var} (Y|X=x)}" loading="lazy"></span> defines a constant for possible values of <i>x</i>, and in particular, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \operatorname {Var} (Y|X=x)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>Var</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo>=</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \operatorname {Var} (Y|X=x)}</annotation>
</semantics>
</math></span><img src="./a66f3b2841f2ad6a14a857e03d3736d6c34ffce3.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:14.455ex; height:2.843ex;" alt="{\displaystyle \operatorname {Var} (Y|X=x)}" loading="lazy"></span>, is <i>not</i> a random variable.
</p><p>The connection of this definition to <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \operatorname {Var} (Y|X)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>Var</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \operatorname {Var} (Y|X)}</annotation>
</semantics>
</math></span><img src="./8ecd7c8c3c37799ea017d00fdba6e619b5939757.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:10.027ex; height:2.843ex;" alt="{\displaystyle \operatorname {Var} (Y|X)}" loading="lazy"></span> is as follows:
Let <i>S</i> be as above and define the function <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle v:S\to \mathbb {R} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>v</mi>
<mo>:</mo>
<mi>S</mi>
<mo stretchy="false">→<!-- → --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">R</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle v:S\to \mathbb {R} }</annotation>
</semantics>
</math></span><img src="./8050f373b900bfc9947d7cc2a231d24032f0bd1a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:9.856ex; height:2.176ex;" alt="{\displaystyle v:S\to \mathbb {R} }" loading="lazy"></span> as <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle v(x)=\operatorname {Var} (Y|X=x)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>v</mi>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mi>Var</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo>=</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle v(x)=\operatorname {Var} (Y|X=x)}</annotation>
</semantics>
</math></span><img src="./32c555fd715de93dc4870062a95d5cd06a998dc8.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:21.82ex; height:2.843ex;" alt="{\displaystyle v(x)=\operatorname {Var} (Y|X=x)}" loading="lazy"></span>. Then, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle v(X)=\operatorname {Var} (Y|X)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>v</mi>
<mo stretchy="false">(</mo>
<mi>X</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mi>Var</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle v(X)=\operatorname {Var} (Y|X)}</annotation>
</semantics>
</math></span><img src="./16107aaf0821ff750c52406f25cfb281fe66bad5.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:18.042ex; height:2.843ex;" alt="{\displaystyle v(X)=\operatorname {Var} (Y|X)}" loading="lazy"></span> <a href="Almost_surely" title="Almost surely">almost surely</a>.
</p>
<div class="mw-heading mw-heading3"><h3 id="Definition_using_conditional_distributions">Definition using conditional distributions</h3></div>
<p>The "conditional expectation of <i>Y</i> given <i>X=x</i>" can also be defined more generally
using the <a href="Conditional_distribution" class="mw-redirect" title="Conditional distribution">conditional distribution</a> of <i>Y</i> given <i>X</i> (this exists in this case, as both here <i>X</i> and <i>Y</i> are real-valued).
</p><p>In particular, letting <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle P_{Y|X}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>P</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle P_{Y|X}}</annotation>
</semantics>
</math></span><img src="./ec0782d99808b0609a7c5cde6138a7dab9f8a340.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.171ex; width:4.836ex; height:3.009ex;" alt="{\displaystyle P_{Y|X}}" loading="lazy"></span> be the (regular) <a href="Conditional_distribution" class="mw-redirect" title="Conditional distribution">conditional distribution</a> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle P_{Y|X}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>P</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle P_{Y|X}}</annotation>
</semantics>
</math></span><img src="./ec0782d99808b0609a7c5cde6138a7dab9f8a340.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.171ex; width:4.836ex; height:3.009ex;" alt="{\displaystyle P_{Y|X}}" loading="lazy"></span> of <i>Y</i> given <i>X</i>, i.e., <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle P_{Y|X}:{\mathcal {B}}\times \mathbb {R} \to [0,1]}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>P</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
</mrow>
</msub>
<mo>:</mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi class="MJX-tex-caligraphic" mathvariant="script">B</mi>
</mrow>
</mrow>
<mo>×<!-- × --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">R</mi>
</mrow>
<mo stretchy="false">→<!-- → --></mo>
<mo stretchy="false">[</mo>
<mn>0</mn>
<mo>,</mo>
<mn>1</mn>
<mo stretchy="false">]</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle P_{Y|X}:{\mathcal {B}}\times \mathbb {R} \to [0,1]}</annotation>
</semantics>
</math></span><img src="./88ddda966175068cbdbbc030c735007ba9e68e13.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.171ex; width:21.102ex; height:3.176ex;" alt="{\displaystyle P_{Y|X}:{\mathcal {B}}\times \mathbb {R} \to [0,1]}" loading="lazy"></span> (the intention is that <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle P_{Y|X}(U,x)=P(Y\in U|X=x)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>P</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>U</mi>
<mo>,</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mi>P</mi>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mo>∈<!-- ∈ --></mo>
<mi>U</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo>=</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle P_{Y|X}(U,x)=P(Y\in U|X=x)}</annotation>
</semantics>
</math></span><img src="./859f9afd733c5d100bcee270cf63bf0aa3ef5484.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.171ex; width:30.896ex; height:3.176ex;" alt="{\displaystyle P_{Y|X}(U,x)=P(Y\in U|X=x)}" loading="lazy"></span> almost surely over the support of <i>X</i>), we can define
</p><p><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \operatorname {Var} (Y|X=x)=\int \left(y-\int y'P_{Y|X}(dy'|x)\right)^{2}P_{Y|X}(dy|x).}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>Var</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
<mo>=</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mo>∫<!-- ∫ --></mo>
<msup>
<mrow>
<mo>(</mo>
<mrow>
<mi>y</mi>
<mo>−<!-- − --></mo>
<mo>∫<!-- ∫ --></mo>
<msup>
<mi>y</mi>
<mo>′</mo>
</msup>
<msub>
<mi>P</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>d</mi>
<msup>
<mi>y</mi>
<mo>′</mo>
</msup>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>x</mi>
<mo stretchy="false">)</mo>
</mrow>
<mo>)</mo>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<msub>
<mi>P</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>X</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>d</mi>
<mi>y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \operatorname {Var} (Y|X=x)=\int \left(y-\int y'P_{Y|X}(dy'|x)\right)^{2}P_{Y|X}(dy|x).}</annotation>
</semantics>
</math></span><img src="./6c96f192c447f9a123fbfccc1d909731f47fa57f.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:56.354ex; height:6.509ex;" alt="{\displaystyle \operatorname {Var} (Y|X=x)=\int \left(y-\int y'P_{Y|X}(dy'|x)\right)^{2}P_{Y|X}(dy|x).}" loading="lazy"></span>
</p><p>This can, of course, be specialized to when <i>Y</i> is discrete itself (replacing the integrals with sums), and also when the <a href="Conditional_density" class="mw-redirect" title="Conditional density">conditional density</a> of <i>Y</i> given <i>X=x</i> with respect to some underlying distribution exists.
</p>
<div class="mw-heading mw-heading2"><h2 id="Components_of_variance">Components of variance</h2></div>
<p>The <a href="Law_of_total_variance" title="Law of total variance">law of total variance</a> says
</p><p><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \operatorname {Var} (Y)=\operatorname {E} (\operatorname {Var} (Y\mid X))+\operatorname {Var} (\operatorname {E} (Y\mid X)).}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>Var</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Var</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mo>∣<!-- ∣ --></mo>
<mi>X</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">)</mo>
<mo>+</mo>
<mi>Var</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi mathvariant="normal">E</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>Y</mi>
<mo>∣<!-- ∣ --></mo>
<mi>X</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">)</mo>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \operatorname {Var} (Y)=\operatorname {E} (\operatorname {Var} (Y\mid X))+\operatorname {Var} (\operatorname {E} (Y\mid X)).}</annotation>
</semantics>
</math></span><img src="./d1b3ed4b712f420fa5d9c03409cca62d182daa57.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:43.404ex; height:2.843ex;" alt="{\displaystyle \operatorname {Var} (Y)=\operatorname {E} (\operatorname {Var} (Y\mid X))+\operatorname {Var} (\operatorname {E} (Y\mid X)).}" loading="lazy"></span>
</p><p>In words: the variance of <i>Y</i> is the sum of the expected conditional variance of <i>Y</i> given <i>X</i> and the variance of the conditional expectation of <i>Y</i> given <i>X</i>. The first term captures the variation left after "using <i>X</i> to predict <i>Y</i>", while the second term captures the variation due to the mean of the prediction of <i>Y</i> due to the randomness of <i>X</i>.
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Mixed_model" title="Mixed model">Mixed model</a></li>
<li><a href="Random_effects_model" title="Random effects model">Random effects model</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFSpanos1999" class="citation book cs1">Spanos, Aris (1999). "Conditioning and regression". <a rel="nofollow" class="external text" href="https://books.google.com/books?id=G0_HxBubGAwC&pg=PA342"><i>Probability Theory and Statistical Inference</i></a>. New York: Cambridge University Press. pp. 339–356 [p. 342]. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>0-521-42408-9</bdi>.</cite></span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="Further_reading">Further reading</h2></div>
<ul><li><cite id="CITEREFCasellaBerger2002" class="citation book cs1">Casella, George; Berger, Roger L. (2002). <a rel="nofollow" class="external text" href="https://books.google.com/books?id=0x_vAAAAMAAJ&pg=PA151"><i>Statistical Inference</i></a> (Second ed.). Wadsworth. pp. <span class="nowrap">151–</span>52. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>0-534-24312-6</bdi>.</cite></li></ul>
<p><br>
</p>
<style data-mw-deduplicate="TemplateStyles:r1271159938">
/* start https://en.wikipedia.org/ */
.mw-parser-output .asbox{position:relative;overflow:hidden}.mw-parser-output .asbox table{background:transparent}.mw-parser-output .asbox p{margin:0}.mw-parser-output .asbox p+p{margin-top:0.25em}.mw-parser-output .asbox-body{font-style:italic}.mw-parser-output .asbox-note{font-size:smaller}.mw-parser-output .asbox .navbar{position:absolute;top:-0.75em;right:1em;display:none}.mw-parser-output :not(p):not(.asbox)+style+.asbox,.mw-parser-output :not(p):not(.asbox)+link+.asbox{margin-top:3em}
/* end https://en.wikipedia.org/ */
</style>
</div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2024-06-04" href="https://en.wikipedia.org/wiki/?title=Conditional_variance&oldid=1227198891">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>